package edu.sias.course.mapper;

import edu.sias.course.domain.entity.TagPageQueryParams;
import edu.sias.course.domain.pojo.Tag;

import edu.sias.course.domain.vo.TagVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Description TagMapper
 * @Author songyu
 * @Date 2023-08-31
 */
@Mapper
public interface TagMapper {

    @Select("select count(*) from course_tag where course_id = #{courseId}")
    Integer selectCountTagByCourseId(Integer courseId);

    /**
     * 根据学科id查询学科标签列表
     * @param courseId
     * @return
     */
    @Select("select * from course_tag where course_id = #{courseId}")
    List<Tag> findListByCourseId(Integer courseId);

    /**
     * 添加标签
     * @param tag
     * @return
     */
    Integer addTag(Tag tag);

    /**
     * 根据条件查询标签列表数据
     * @param queryParams
     * @return
     */
    List<TagVO> findByCondition(TagPageQueryParams queryParams);

    /**
     * 删除标签
     * @param id
     * @return
     */
    Integer deleteTag(Integer id);

    List<Tag> findListByQuestionId(Integer id);

    /**
     * 更新标签
     * @param
     * @param tag
     * @return
     */
    void update( @Param("arg0") Tag tag);
}
